// 测试is属性
<template>
  <div>
    <!-- <C :cur='currentCompent'></C>
    <button @click="changeCompent">改变组件</button> -->
    <el-tabs v-model="activeName" @tab-click="handleClick">
      <el-tab-pane :label="tab.label" :name="tab.name" v-for="(tab,index) in tabs" :key="index">
        <component :is="tab.selecompent"></component>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>
<script>
export default {
  data () {
    return {
      currentCompent: 'A',
      activeName: '',
      tabs: [
        {
          name: 'A组件',
          label: 'A组件',
          selecompent: 'A'
        },
        {
          name: 'B组件',
          label: 'B组件',
          selecompent: 'B'
        }
      ]
    }
  },
  methods: {
    changeCompent () {
      this.currentCompent = 'B'
    },
    handleClick () {
      console.log(11)
    }
  }
}
</script>
